package service.v2;

import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.MalformedURLException;
import java.util.List;
import java.util.Map;
import java.util.SortedMap;

import javax.servlet.http.HttpServletRequest;

import com.alipay.api.response.AlipayTradeRefundResponse;
import com.paypal.base.rest.PayPalRESTException;

import dao.v2.PayVOMapper;
import model.AddressVO;
import model.LogBuyCashVO;
import model.LogEarnVO;
import model.LogPackageVO;
import model.MemberVO;
import model.OrderPayVO;
import model.OrderRefund;
import model.PackagePayVO;
import model.PackageVO;

public interface PayService {

	Object wxPrePay(String no, String price, String body, HttpServletRequest request, String url);

	SortedMap<Object, Object> resolveWechatParam(HttpServletRequest request)  throws Exception;

	String checkWechatParam(SortedMap<Object, Object> packageParams);

	Object aliPrePay(String no, String price, String body, HttpServletRequest request, String url) throws Exception;

	boolean checkAliParam(Map<String, String> params) ;

	Map<String, String> resolveAliParam(HttpServletRequest request) throws Exception;

	String genPayOrder(int type, String free_cash, String remark, int pay_type, String member_id);

	OrderPayVO getPayOrderByNo(String out_trade_no);

	int subFreeCash(String member_id, double price, String ticket, String rate, String country);

	String insertMemberTicket(OrderPayVO payVO ,String member_id, String ticket, String rate, int pay_type, String partner_level, String country) throws Exception;

	void updatePayOrderParams(String no, String jsonString);
	
	void updOrderAfterPay(String state,String pay_type,String conn_pay_id,String[] order_id_list);
	
	void updatePayOrderState1(String state,String id);
	
	void delOrderTimer(String[] order_id_list);

	String wechatRefund(HttpServletRequest request,String out_trade_no, String out_refund_no, String total_fee, String refund_fee,String trade_type) throws Exception;

	AlipayTradeRefundResponse alipayRefund(String out_trade_no, String out_refund_no, String total_fee,
			String refund_fee) throws Exception;
	
	OrderRefund getOrderRefundBy(String refund_id);
	
	
	
	LogPackageVO getLogPackageById(String id);
	
	LogPackageVO getLogPackageByNo(String no);
	
	void updLogPackage(LogPackageVO packageLog);
	
	int getToTalPackageTicket(String package_id);
	
	int getToTalPackageAward(String package_id);
	
	void addLogEarn(LogEarnVO log);
	
	void addLogBuyCash(LogBuyCashVO  log);
	
	int chetckOrderState(String[] order_id_list);
	
	void addPackagePay(PackagePayVO packPay);
	
	PackagePayVO getPackagePay(String id);
	
	PackagePayVO getPackagePayByNo(String no);

	int updateOrderPayFinish(OrderPayVO payVO);
	
	int checkPackage(String package_id,String standard_id);
	
	Map<String, Object> insertPackage(PackageVO pack,MemberVO member,AddressVO addressVO,String pay_type,String conn_pay_id,String order_from,String country);
	
	Map<String, Object> insertPackage1(PackageVO pack,MemberVO member,AddressVO addressVO,String pay_type,String conn_pay_id,OrderPayVO payVO,String order_from,String country);
	
	void shareBenifit(String[] order_id_List,MemberVO memberVO);

	void updTest();

	int subFreeCashEn(String member_id, double price, String ticket, String rate, String country);

	Object payssionPrePay(String no, String price, String body, HttpServletRequest request, String url, String pay_key);

	Map<String, String> resolveAPayssionParam(HttpServletRequest request);

	boolean checkPayssionParam(OrderPayVO payVO, Map<String, String> params);

	Object paypalPrePay(String no, String price, String body, HttpServletRequest request, String url, String return_url,
			String cancel_url) throws PayPalRESTException;

	boolean checkPayPalParam(HttpServletRequest request) throws UnsupportedEncodingException, MalformedURLException, IOException;

}
